package nowcoder.hw.hj106;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String line = bufferedReader.readLine();
        //0.常规思路，逆序遍历一遍整个数组，依次拼接
        //1.stringbuilder的reverse()方法
//        System.out.println(new StringBuilder(line).reverse());
        //2.参考reverse方法,一次遍历，对半交换
        char[] chars = line.toCharArray();
        int n=chars.length;
        for (int i = 0; i < chars.length/2; i++) {
            char a=chars[i];
            char b =chars[n-i-1];
            chars[n-i-1]=a;
            chars[i]=b;
        }
        System.out.println(String.valueOf(chars));
    }
}
